package com.xy.entity.product;

import com.alibaba.fastjson.annotation.JSONField;
import com.xy.common.jpa.AbstractTimestampEntity;
import com.xy.entity.msg.ActivityMsg;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.*;


@Entity
@Data
@Table(name = "picture")
public class Picture extends AbstractTimestampEntity{

    @ApiModelProperty(value="链接",name="url")
    private String url;
    @ApiModelProperty(value="宽",name="width")
    private int width;
    @ApiModelProperty(value="高",name="height")
    private int height;
    @ApiModelProperty(value="场景备注 1轮播   2缩略  3产品展示图",name="remark")
    private String remark;
    @ApiModelProperty(value="跳转链接",name="linkurl")
    private String linkurl;
    @ApiModelProperty(value="表示：首页  产品  订单",name="sort")
    @JSONField(serialize = false)
    private String sort;
    @JSONField(serialize = false)
    @JoinColumn(name = "product_id")
    @ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.EAGER)
    private Product product;

  //外键关联活动信息主键
  /*  @JSONField(serialize = false)
    @ManyToOne(cascade = {CascadeType.REFRESH}, fetch = FetchType.EAGER)
    @JoinColumn(name = "activityMsg_id")
    private ActivityMsg activityMsg;*/


}
